package com.hannesdorfmann.mosby3.mvi;

import com.hannesdorfmann.mosby3.mvp.MvpView;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;

import static org.junit.Assert.*;

public class MviBasePresenterTest {
    MviBasePresenter mviBasePresenter;
    MvpView mvpView;

    @Before
    public void setUp() throws Exception {
        mvpView = new MvpView() {
            @Override
            public int hashCode() {
                return super.hashCode();
            }
        };
        mviBasePresenter = new MviBasePresenter() {
            @Override
            protected void bindIntents() {

            }
        };
    }

    @After
    public void tearDown() throws Exception {
    }

    @Test
    public void getViewStateObservable() {
        assertNotNull(mviBasePresenter.getViewStateObservable());
    }

    @Test
    public void attachView() {
        mviBasePresenter.attachView(mvpView);
        assertNotNull(mviBasePresenter);
    }

    @Test
    public void detachView() {
        mviBasePresenter.detachView();
        assertNotNull(mviBasePresenter);
    }

    @Test
    public void destroy() {
        mviBasePresenter.destroy();
        assertNotNull(mviBasePresenter);
    }

}